package com.itheima.job;

import com.itheima.service.OrderSettingService;
import com.itheima.utils.DateUtil;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.util.Date;

public class CleanerJobBean extends QuartzJobBean {
@Autowired
private OrderSettingService orderSettingService;
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        orderSettingService.cleanTable(DateUtil.formatDate(new Date()));
    }
}
